package com.small.nine.wxmp.domain.bean.wx.kf.msg;

import com.small.nine.wxmp.common.constant.WxConstant;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.HashMap;
import java.util.Map;

/**
 * 客服返回 语音信息
 *
 * @author sheng_zs@126.com
 * @date 2021-08-06 17:13
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class WxKfVoiceMsgBean extends WxKfMsgBaseBean {
    private static final long serialVersionUID = 1L;

    /**
     * 图片内容
     */
    private Map<String, String> voice;

    /**
     * 初始化，并返回
     *
     * @param toUser  发送对象
     * @param mediaId 语音 ID
     * @return {@link WxKfVoiceMsgBean}
     */
    public static WxKfVoiceMsgBean getInstance(String toUser, String mediaId) {
        WxKfVoiceMsgBean msgBean = new WxKfVoiceMsgBean();
        msgBean.setToUser(toUser);
        msgBean.setMsgType(WxConstant.MSG_TYPE_VOICE);
        Map<String, String> map = new HashMap<>();
        map.put(WxConstant.PARAM_MEDIA_ID, mediaId);
        msgBean.setVoice(map);
        return msgBean;
    }
}
